package com.xiaoge.controller;

import org.springframework.stereotype.Component;
import org.springframework.web.HttpRequestHandler;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * TODO BeanNameUrlHandlerMapping它会专门收集bean名称带/的bean
 * 		实现Controller/HttpRequestHandler一样的只是返回值不一样而已
 *
 * @author <a href="mailto:1330137071@qq.com">Zhang Xiao</a>
 * @since
 */
@Component("/test")
public class ZhangXiaoBeanNameController implements Controller/*, HttpRequestHandler */ {
//	@Override
//	public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//		System.out.println("测试 BeanNameUrlHandlerMapping");
//	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		System.out.println("测试 BeanNameUrlHandlerMapping");
		return null;
	}

}
